﻿using AppMain;
using System;
using System.Collections.Generic;

namespace BehaviorTree
{
    public class BMonsterPatrolCond : BTCondition
    {
        public BMonsterPatrolCond(ActionRole agent) : base(agent)
        {
        }

        public override Node_Status tick(float frameTime)
        {
            float time = this.agent.AttrMap.getAttr<float>(RoleAttr.RestTime).Value;

            if (time > 0f && this.agent.IsFree)
            {
                return Node_Status.Success;
            }
            else
            {
                return Node_Status.Fail;
            }
        }

    }
}
